<template>
	<view>
		<view class="" :style="{height: systemBarHeight + 'px'}">
		</view>
		<view class="navbar">
			<uni-nav-bar @clickLeft="fh" :border="false" left-icon="left" title="搜索结果" />
		</view>

		<view class="search">
			<image src="/static/search.png" mode=""></image>
			<input type="text" value="" placeholder="搜索" />
			<text>搜索</text>
		</view>
		<view class="tabs">
			<v-tabs v-model="current" color="#7D8CA4" activeColor='#152034' lineColor='#386AF6' :lineScale='0.2'
				:tabs="tabs" :scroll="false" @change="changeTab"></v-tabs>
		</view>


		<!-- 文章 -->
		<view class="article" v-if="current==0">
			<view class="articlelist">
				<!-- 单文张 -->
				<view class="articlelist_item1">
					<view class="articlelist_item1_tit">
						<text>智能化普及风暴，零跑全新机器人时代2月上市定位3ss级别别别影响力接口连接离开蛔…</text>
					</view>

					<view class="articlelist_item1_browse">
						<text>孙悟空 · 88浏览 · 999评论</text>
					</view>
				</view>
				<!-- 文章加单图 -->
				<view class="articlelist_item2">
					<view class="articlelist_item2_lf">
						<view class="articlelist_item2_lf_tit">
							<text>智能化普及风暴，零跑全新机器人时代2月上市定位…</text>
						</view>
						<view class="articlelist_item2_lf_browse">
							<text>孙悟空 · 88浏览 · 999评论</text>
						</view>
					</view>
					<view class="articlelist_item2_rg">
						<image src="/static/logo.png" mode=""></image>
					</view>
				</view>
				<!-- 文章加多图 -->
				<view class="articlelist_item3">
					<view class="articlelist_item3_tit">
						<text>智能化普及风暴，零跑全新机器人时代2月上市定位3ss级别</text>
					</view>
					<view class="articlelist_item3_imgitem">
						<image src="/static/logo.png" mode=""></image>
						<image src="/static/logo.png" mode=""></image>
						<image src="/static/logo.png" mode=""></image>
					</view>

					<view class="articlelist_item3_browse">
						<text>孙悟空 · 88浏览 · 999评论</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 视频 -->
		<view class="video" v-if="current==1">
			<view class="videolist">
				<view class="videolist_item">
					<view class="videolist_item_tit">
						<text>智能化普及风暴，零跑全新机器人时代2月上市定位3ss级别</text>
					</view>
					<view class="videolist_item_video">
						<view class="video1">
							<image src="/static/logo.png" mode=""></image>
						</view>
						<image src="/static/bofang.png" mode=""></image>
						<view class="video2">
							<text>99.99</text>
						</view>
					</view>
					<view class="videolist_item_browse">
						<text>孙悟空 · 88浏览 · 999评论</text>
					</view>
				</view>
			</view>
		</view>

		<view class="product" v-if="current==2">
			<view class="productlist">
				<view class="productlist_item">
					<view class="productlist_item_lf">
						<image src="/static/logo.png" mode=""></image>
					</view>
					
					<view class="productlist_item_rg">
						<view class="productlist_item_rg_tit">
							<text>CyberDog仿生四足机器人（工程探索版）</text>
						</view>
						
						<view class="productlist_item_bom">
							<view class="productlist_item_bom_lf">
								<text class="type1">身高</text>
								<text class="type2">400mm</text>
							</view>
							<view class="productlist_item_bom_lf">
								<text class="type1">体重</text>
								<text class="type2">14kg</text>
							</view>
							
							<view class="productlist_item_bom_bt">
								<button type="default">去咨询</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import indexList from '../../uni_modules/uview-ui/libs/config/props/indexList';

	export default {
		data() {
			return {
				systemBarHeight: 0,
				current: 2,
				tabs: [
					'文章',
					'视频',
					'产品',
				],
			}
		},
		mounted() {
			this.getSysteminfo()
		},
		methods: {
			/* 手机顶部高度 */
			getSysteminfo() {
				uni.getSystemInfo({
					success: res => {
						this.systemBarHeight = res.statusBarHeight;
					}
				});
			},
			fh() {
				uni.navigateBack({
					delta: 1 // 返回的页面层级，1表示返回上一页
				});
			},
			changeTab(index) {
				this.current = index
			}
		}
	}
</script>

<style lang="scss" scoped>
	.search {
		width: 91%;
		margin: 20rpx auto 0;
		height: 57rpx;
		background: #FFFFFF;
		border-radius: 55rpx 55rpx 55rpx 55rpx;
		border: 1rpx solid #1677FF;
		display: flex;
		align-items: center;

		>image {
			width: 30.53rpx;
			height: 30.53rpx;
			margin-left: 22rpx;
		}

		>input {
			height: 32rpx;
			margin-left: 15rpx;
			width: 75%;
			border-right: 2rpx solid #DAEBFF;
		}

		>text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 23rpx;
			color: #1677FF;
			margin-left: auto;
			margin-right: 28rpx;
		}
	}

	.search input /deep/ .input-placeholder {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 23rpx;
		color: #CCCCCC;
	}

	.tabs {
		width: 60%;
		margin: auto;
		padding-bottom: 30rpx;
	}

	.articlelist {
		width: 91%;
		margin: auto;

		.articlelist_item1 {
			padding-bottom: 30rpx;
			margin-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			.articlelist_item1_tit {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 31rpx;
				color: #152034;
				display: -webkit-box;
				/* 设置为WebKit内核的弹性盒子模型 */
				-webkit-box-orient: vertical;
				/* 垂直排列 */
				-webkit-line-clamp: 2;
				/* 限制显示三行 */
				overflow: hidden;
				/* 隐藏超出范围的内容 */
				text-overflow: ellipsis;
			}

			.articlelist_item1_browse {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 23rpx;
				color: #7D8CA4;
				margin-top: 30rpx;
			}
		}

		.articlelist_item2 {
			padding-bottom: 30rpx;
			margin-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
			display: flex;

			.articlelist_item2_lf {
				.articlelist_item2_lf_tit {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 31rpx;
					color: #152034;
					display: -webkit-box;
					/* 设置为WebKit内核的弹性盒子模型 */
					-webkit-box-orient: vertical;
					/* 垂直排列 */
					-webkit-line-clamp: 2;
					/* 限制显示三行 */
					overflow: hidden;
					/* 隐藏超出范围的内容 */
					text-overflow: ellipsis;
				}

				.articlelist_item2_lf_browse {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 23rpx;
					color: #7D8CA4;
					margin-top: 30rpx;
				}
			}

			.articlelist_item2_rg {
				>image {
					width: 229rpx;
					height: 172rpx;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
				}
			}
		}

		.articlelist_item3 {
			padding-bottom: 30rpx;
			margin-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			.articlelist_item3_tit {

				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 31rpx;
				color: #152034;

			}

			.articlelist_item3_imgitem {
				display: flex;
				justify-content: space-between;
				margin-top: 15rpx;

				>image {
					width: 219rpx;
					height: 168rpx;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
				}
			}

			.articlelist_item3_browse {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 23rpx;
				color: #7D8CA4;
				margin-top: 30rpx;
			}
		}
	}

	.video {
		width: 91%;
		margin: auto;

		.videolist_item {
			padding-bottom: 30rpx;
			margin-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			.videolist_item_tit {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 31rpx;
				color: #071F3A;
			}

			.videolist_item_video {
				margin-top: 26rpx;
				display: flex;
				align-items: center;
				
				width: 691rpx;
				position: relative;
				justify-content: center;
				
				.video1 {
				
					>image {
						width: 691rpx;
						height: 389rpx;
						border-radius: 0rpx 0rpx 0rpx 0rpx;
					}
				}
				
				>image {
					width: 107.17rpx;
					height: 109.01rpx;
					position: absolute;
					z-index: 1;
					margin: auto;
					top: auto;
				
					bottom: auto;
				
				}
				
				.video2 {
					width: 80rpx;
					position: absolute;
					bottom: 0;
					right: 15rpx;
					bottom: 30rpx;
					z-index: 11;
					height: 35rpx;
					background: rgba(0, 0, 0, 0.3);
					border-radius: 4rpx 4rpx 4rpx 4rpx;
				
				
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 23rpx;
					color: #FFFFFF;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}

			.videolist_item_browse {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 23rpx;
				color: #7D8CA4;
				margin-top: 30rpx;
			}
		}
	}

	.product {
		width: 91%;
		margin: auto;

		.productlist {
			.productlist_item {
				display: flex;
				.productlist_item_lf {
					>image{
						width: 229rpx;
						height: 172rpx;
						border-radius: 0rpx 0rpx 0rpx 0rpx;
					}
				}
				.productlist_item_rg{
					margin-left: 30rpx;
					.productlist_item_rg_tit{
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 31rpx;
						color: #152034;
					}
					.productlist_item_bom{
						display: flex;
						align-items: center;
						margin-top: 17rpx;
						.productlist_item_bom_lf{
							display: flex;
							flex-direction: column;
							margin-right: 45rpx;
							.type1{
								font-family: PingFang SC, PingFang SC;
								font-weight: 400;
								font-size: 23rpx;
								color: #7D8CA4;
							}
							.type2{
								font-family: PingFang SC, PingFang SC;
								font-weight: 400;
								font-size: 23rpx;
								color: #45516B;
								margin-top: 10rpx;
							}
						}
						
						.productlist_item_bom_bt{
							margin-left: auto;
						}
					}
					
					
					
				}

			}
		}
	}
	
	.productlist_item_bom_bt button{
		width: 153rpx;
		height: 69rpx;
		background: #1677FF;
		border-radius: 38rpx 38rpx 38rpx 38rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 27rpx;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>